//
//  ProtocolService.h
//  healthApp
//
//  Created by william mu on 12-8-28.
//  Copyright (c) 2012年 Tencent. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef  void (^ResponseHandler)(NSURLResponse *response, NSData *data, NSError *error);

@interface ProtocolService : NSObject <NSURLConnectionDelegate>
{
    @private
    id m_target;
    SEL m_action;
    NSOperationQueue* m_queue;
    ResponseHandler m_handler;
    NSMutableDictionary* m_request_map;
}

+(ProtocolService*) sharedInstance;

-(void) setTarget:(id) target;

-(void) setAction:(SEL) action;

-(void) pushCallback;

-(void) popCallback;

-(NSString*) loginWithUserName:(NSString*) userName password:(NSString*) password;

-(NSString*) requestHealthInfo:(NSString*) uid;

-(NSString*) requestMyUid;

-(NSString*) getUserHealthInfo:(NSString*) uid;

-(NSString*) getHealthFieldMap;

-(NSString*) getFriendRequest:(NSString*) uid;

-(NSString*) requestUserBaseInfo:(NSString*) uid;

-(NSString*) getUserFriends:(NSString*) uid;

-(NSString*) getSharedSymptom:(NSString*) uid;

-(NSString*) getSymptomMap;

-(NSString*) getAllSymptom:(NSString*) uid;

-(NSString*) updateHealthInfo:(NSString*) uid field:(NSString*) field value:(NSString*) value;

-(NSString*) handleFriendReq:(NSString*) req_uid  accept:(NSString*)accept;

-(NSString*) updateSymptomShare:(NSString*) uid symptomType:(NSString*) symptomType  shared:(NSString*) shared;

-(NSString*) addSymptom:(NSString*) uid symptomType:(NSString*) symptomType shared:(NSString*) shared;

-(NSString*) deleteSymptom:(NSString*) uid symptomType:(NSString*) symptomType;

-(NSString*) getHistoryData:(NSString*) uid field:(NSString*) field;

-(void) shutdownAnyResponse:(NSArray*) requestSeq;
@end
